2015.02.18


In [5]:
# Standard setup block for running Python code
from __future__ import division, print_function
import os
if os.path.split(os.getcwd())[-1] == "Lab notebooks":
    os.chdir("../../")
    print("Moved to experiment root directory")
from Modules.processing import *
from Modules.plotting import *
plt.style.use("Config/plotstyle.mplstyle")
%matplotlib inline

Daily checklist

  • Check tank depth and correct if necessary.
  • Home turbine axis.
  • Home tow axis.
  • Home y-axis.
  • Home z-axis.
  • Wipe any corrosion from turbine mounting frame.
  • Seed and mix tank until Vectrino SNR is approximately 12 dB.

Started at 8 AM.

Removed turbine servo motor and guy wires. Going to pull out frame, measure backlash in lower flange connection, remove blades, and reinstall frame for measuring strut torque.

10:26 AM -- Blades are removed and frame is back in the water. Dye seems to have seeped out of blades 1 and 3, but not 2, which is strange.

Backlash in upper turbine shaft flange was due to the bolts loosening over the experiment, which is strange given the jam nuts on the lower part of the bolts. Backlash at outer diameter of circular flange was about 0.175 inches.

Retorqued bolts and jam nuts on turbine shaft flanges. Hub section and blade bolts remained tight.

11:30 AM -- Starting strut torque runs. Waiting 30 seconds between each.

12:00 PM -- Finished strut torque runs. Data looks reasonable--estimating a 0.02 drop in $C_P$ due to strut drag at 1.0 m/s, $\lambda = 3.1$. Backing up data.

2:17 PM -- Need to evacuate the building according to the Durham FD.


In [86]:
process_strut_torque(24, plot=True, verbose=True)


Processing strut torque run 24
Reference TSR = 4.7496
Strut torque = -1.33322299946 Nm at 84.3821127503 RPM
Out[86]:
(4.7496048737318191, 0.045494521497676521)

In [88]:
tsr_ref = []
cp_loss = []
for n in range(26):
    tsr, cp = process_strut_torque(n)
    tsr_ref.append(tsr)
    cp_loss.append(cp)
    
plt.plot(tsr_ref, cp_loss, "-o") 
plt.xlabel("$\lambda$")
plt.ylabel("$C_P$ loss estimate")
plt.show()



In [87]:
def process_strut_torque(nrun, zero_torque=1.1, plot=False, covers=False, verbose=False):
    """Processes a single strut torque run."""
    testplan = pd.read_csv("Config/Test plan/Strut-torque.csv", index_col="run")
    ref_speed = testplan.ref_speed.iloc[nrun]
    tsr_nom = testplan.tsr.iloc[nrun]
    revs = testplan.revs.iloc[nrun]
    rpm_nom = tsr_nom*ref_speed/R/(2*np.pi)*60
    dur = revs/rpm_nom*60
    if covers:
        if verbose:
            print("Processing strut torque with covers run", nrun)
        nidata = loadhdf("Data/Raw/Strut-torque-covers/" + str(nrun) + "/nidata.h5")
    else:
        if verbose:
            print("Processing strut torque run", nrun)
        nidata = loadhdf("Data/Raw/Strut-torque/" + str(nrun) + "/nidata.h5")
    # Compute RPM
    time_ni  = nidata["time"]
    angle = nidata["turbine_angle"]
    rpm_ni = fdiff.second_order_diff(angle, time_ni)/6.0
    rpm_ni = ts.smooth(rpm_ni, 8)
    t1, t2 = 9, dur
    meanrpm, _ = ts.calcstats(rpm_ni, t1, t2, 2000)
    torque = nidata["torque_trans"]
#     torque = torque - np.mean(torque[:2000]) # 2000 samples of zero torque
    meantorque, _ = ts.calcstats(torque, t1, t2, 2000)
    tsr_ref = meanrpm/60.0*2*np.pi*R/ref_speed
    if verbose:
        print("Reference TSR =", np.round(tsr_ref, decimals=4))
        print("Strut torque =", meantorque, "Nm at", meanrpm, "RPM")
    if plot:
        plt.figure()
        plt.plot(time_ni, torque)
        plt.xlabel("Time (s)")
        plt.ylabel("Torque (Nm)")
        plt.tight_layout()
        plt.show()
    meantorque -= zero_torque
    ct = -meantorque/(0.5*rho*A*R*ref_speed**2)
    cp = ct*tsr_ref
    return tsr_ref, cp

In [59]:
# Calculating tare torque test matrix for experiment
def calc_rpm((tow_speed, tsr)):
    omega = tsr*tow_speed/R
    return omega/(2*np.pi)*60.0

save = False
lowest = (0.2, 1.0) # tow_speed, tsr
highest = (1.4, 4.0)

rpm_start = calc_rpm(lowest)
rpm_end = calc_rpm(highest)

steps = 25

rpms = np.linspace(rpm_start, rpm_end, steps)
revs = np.ones(len(rpms))*30.0
revs[0] = 4
revs[1] = 8
revs[2] = 12
revs[3] = 16
revs[4] = 20
revs[5] = 24
revs[-1] = 32

df = pd.DataFrame()

df["rpm"] = rpms
df.index.name = "run"
df["revs"] = revs
if save:
    df.to_csv("Config/Test plan/Tare-torque.csv")
df["minutes"] = revs/rpms
df["samples"] = np.floor(df.minutes*60*2000)
df["samples_per_rev"] = df.samples/df.revs
print("Total time (minutes):", df.minutes.sum())
df


Total time (minutes): 16.6644519302
Out[59]:
rpm revs minutes samples samples_per_rev
run
0 3.553227 4 1.125737 135088 33772.000000
1 7.550607 8 1.059518 127142 15892.750000
2 11.547987 12 1.039142 124697 10391.416667
3 15.545367 16 1.029246 123509 7719.312500
4 19.542747 20 1.023398 122807 6140.350000
5 23.540126 24 1.019536 122344 5097.666667
6 27.537506 30 1.089423 130730 4357.666667
7 31.534886 30 0.951327 114159 3805.300000
8 35.532266 30 0.844303 101316 3377.200000
9 39.529646 30 0.758924 91070 3035.666667
10 43.527026 30 0.689227 82707 2756.900000
11 47.524406 30 0.631255 75750 2525.000000
12 51.521786 30 0.582278 69873 2329.100000
13 55.519166 30 0.540354 64842 2161.400000
14 59.516546 30 0.504062 60487 2016.233333
15 63.513926 30 0.472337 56680 1889.333333
16 67.511306 30 0.444370 53324 1777.466667
17 71.508686 30 0.419529 50343 1678.100000
18 75.506066 30 0.397319 47678 1589.266667
19 79.503446 30 0.377342 45281 1509.366667
20 83.500826 30 0.359278 43113 1437.100000
21 87.498206 30 0.342864 41143 1371.433333
22 91.495586 30 0.327885 39346 1311.533333
23 95.492966 30 0.314159 37699 1256.633333
24 99.490346 32 0.321639 38596 1206.125000